package net.betou.cms.entity.main.base;

import java.io.Serializable;

/**
 * This is an object that contains data related to the bt_log table. Do not
 * modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 * 
 * @hibernate.class table="bt_log"
 */

public abstract class BaseCmsLog implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 443728464346796976L;
	public static String REF = "CmsLog";
	public static String PROP_TIME = "time";
	public static String PROP_SITE = "site";
	public static String PROP_USER = "user";
	public static String PROP_URL = "url";
	public static String PROP_IP = "ip";
	public static String PROP_CATEGORY = "category";
	public static String PROP_TITLE = "title";
	public static String PROP_CONTENT = "content";
	public static String PROP_ID = "id";

	// constructors
	public BaseCmsLog( ) {
		initialize( );
	}

	/**
	 * Constructor for primary key
	 */
	public BaseCmsLog( java.lang.Integer id ) {
		this.setId( id );
		initialize( );
	}

	/**
	 * Constructor for required fields
	 */
	public BaseCmsLog( java.lang.Integer id, java.lang.Integer category, java.util.Date time ) {

		this.setId( id );
		this.setCategory( category );
		this.setTime( time );
		initialize( );
	}

	protected void initialize( ) {
	}

	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.Integer category;
	private java.util.Date time;
	private java.lang.String ip;
	private java.lang.String url;
	private java.lang.String title;
	private java.lang.String content;

	// many to one
	private net.betou.cms.entity.main.CmsUser user;
	private net.betou.cms.entity.main.CmsSite site;

	/**
	 * Return the unique identifier of this class
	 * 
	 * @hibernate.id generator-class="identity" column="log_id"
	 */
	public java.lang.Integer getId( ) {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * 
	 * @param id
	 *            the new ID
	 */
	public void setId( java.lang.Integer id ) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}

	/**
	 * Return the value associated with the column: category
	 */
	public java.lang.Integer getCategory( ) {
		return category;
	}

	/**
	 * Set the value related to the column: category
	 * 
	 * @param category
	 *            the category value
	 */
	public void setCategory( java.lang.Integer category ) {
		this.category = category;
	}

	/**
	 * Return the value associated with the column: log_time
	 */
	public java.util.Date getTime( ) {
		return time;
	}

	/**
	 * Set the value related to the column: log_time
	 * 
	 * @param time
	 *            the log_time value
	 */
	public void setTime( java.util.Date time ) {
		this.time = time;
	}

	/**
	 * Return the value associated with the column: ip
	 */
	public java.lang.String getIp( ) {
		return ip;
	}

	/**
	 * Set the value related to the column: ip
	 * 
	 * @param ip
	 *            the ip value
	 */
	public void setIp( java.lang.String ip ) {
		this.ip = ip;
	}

	/**
	 * Return the value associated with the column: url
	 */
	public java.lang.String getUrl( ) {
		return url;
	}

	/**
	 * Set the value related to the column: url
	 * 
	 * @param url
	 *            the url value
	 */
	public void setUrl( java.lang.String url ) {
		this.url = url;
	}

	/**
	 * Return the value associated with the column: title
	 */
	public java.lang.String getTitle( ) {
		return title;
	}

	/**
	 * Set the value related to the column: title
	 * 
	 * @param title
	 *            the title value
	 */
	public void setTitle( java.lang.String title ) {
		this.title = title;
	}

	/**
	 * Return the value associated with the column: content
	 */
	public java.lang.String getContent( ) {
		return content;
	}

	/**
	 * Set the value related to the column: content
	 * 
	 * @param content
	 *            the content value
	 */
	public void setContent( java.lang.String content ) {
		this.content = content;
	}

	/**
	 * Return the value associated with the column: user_id
	 */
	public net.betou.cms.entity.main.CmsUser getUser( ) {
		return user;
	}

	/**
	 * Set the value related to the column: user_id
	 * 
	 * @param user
	 *            the user_id value
	 */
	public void setUser( net.betou.cms.entity.main.CmsUser user ) {
		this.user = user;
	}

	/**
	 * Return the value associated with the column: site_id
	 */
	public net.betou.cms.entity.main.CmsSite getSite( ) {
		return site;
	}

	/**
	 * Set the value related to the column: site_id
	 * 
	 * @param site
	 *            the site_id value
	 */
	public void setSite( net.betou.cms.entity.main.CmsSite site ) {
		this.site = site;
	}

	public boolean equals( Object obj ) {
		if( null == obj )
			return false;
		if( !( obj instanceof net.betou.cms.entity.main.CmsLog ) )
			return false;
		else{
			net.betou.cms.entity.main.CmsLog cmsLog = ( net.betou.cms.entity.main.CmsLog ) obj;
			if( null == this.getId( ) || null == cmsLog.getId( ) )
				return false;
			else
				return( this.getId( ).equals( cmsLog.getId( ) ) );
		}
	}

	public int hashCode( ) {
		if( Integer.MIN_VALUE == this.hashCode ){
			if( null == this.getId( ) )
				return super.hashCode( );
			else{
				String hashStr = this.getClass( ).getName( ) + ":" + this.getId( ).hashCode( );
				this.hashCode = hashStr.hashCode( );
			}
		}
		return this.hashCode;
	}

	public String toString( ) {
		return super.toString( );
	}

}